<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>菜品类型修改</title>
<link rel="stylesheet" href="../../../files/css/layui.css" media="all">
<link rel="stylesheet"
	href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://cdn.bootcss.com/jquery/2.1.1/jquery.min.js"></script>
<script
	src="https://cdn.bootcss.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<style type="text/css">
#goodsImg {
	position: relative;
	left: 110px;
}
</style>
</head>
<body>

	<fieldset class="layui-elem-field layui-field-title"
		style="margin-top: 20px;">
		<legend>菜品类型修改列表</legend>
	</fieldset>

	<form class="layui-form" action="../../../menutype/addOrUpdate.action"
		method="post" enctype="multipart/form-data">
		<input type="hidden" id="mtId" name="mtId">
		<div class="layui-form-item">
			<label class="layui-form-label" style="width: 100px;">店铺类型</label>
			<div class="layui-input-inline" lay-filter="selFilter">
				<select name="shopId" lay-verify="required" lay-search=""
					id="typeId">
					<option value="">直接选择或搜索选择</option>
				</select>
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label" style="width: 100px;">类型名称</label>
			<div class="layui-input-inline">
				<input type="text" name="mtName" id="mtName" required
					lay-verify="required" maxlength="12" placeholder="请输入菜品名称"
					autocomplete="off" class="layui-input" class="layui-icon">
			</div>
		</div>

		<div class="layui-form-item">
			<label class="layui-form-label" style="width: 100px;">是否排序</label>
			<div class="layui-input-inline">
				<input type="text" name="sort" id="sort" required
					lay-verify="required" maxlength="12" placeholder="请输入排序号码"
					autocomplete="off" class="layui-input" class="layui-icon">
			</div>
		</div>

		<div class="layui-form-item">
			<div class="layui-input-block">
				<input type="submit" class="layui-btn" lay-submit=""
					lay-filter="goodsUpdate" value="立即提交">
				<button type="reset" class="layui-btn layui-btn-primary">重置</button>
			</div>
		</div>
	</form>


	<script src="../../../files/js/layui.js"></script>
	<script type="text/javascript" src="../../../files/js/jquery.min.js"></script>
	<script>
		layui.use([ 'form', 'tree', 'layer' ], function() {
			var form = layui.form, layer = layui.layer, $ = layui.$;
			form.on('submit(goodsUpdate)', function() {

				layer.msg('数据加载中', {
					icon : 1,
					time : 10
				//2秒关闭（如果不配置，默认是3秒）
				}, function() {
					//进行渲染 
					parent.location.reload(); // 父页面刷新
				});

			});
			$.ajax({
				url : "../../../shop/findAll.action",
				data : {
					action : "findAlls"
				},
				async : false,
				success : function(msg) {
					alert(123);
					for (var i = -0; i < msg.length; i++) {
						$("#typeId").append(
								"<option value="+msg[i].shopId+">"
										+ msg[i].shopName + "</option>");
						form.render();
					}
				},
				dataType : "JSON"
			});
			layer.msg('数据加载中', {
				icon : 1,
				time : 10
			//2秒关闭（如果不配置，默认是3秒）
			}, function() {
				//进行渲染
				form.render();
			});
		});
	</script>

</body>
</html>